/**
 * 
 */
package com.guoxianwei.scm.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.guoxianwei.scm.domain.Department;
import com.guoxianwei.scm.persistence.DepartmentMapper;

/**
 * @author guoxianwei
 *
 */
@Service
public class DepartmentService {

	@Autowired
	private DepartmentMapper departmentMapper;
	
	public List<Department> searchDepartment(Map<String,Object> map) throws Exception{
		return departmentMapper.getDepartment(map);
	}
	
	public int searchDepartmentCount(Map<String,Object> map) throws Exception{
		return departmentMapper.getDepartmentCount(map);
	}
	public  Department getDepartmentById(int id) throws Exception{
		return departmentMapper.getDepartmentById(id);
	}

	@Transactional
	public void removeDepartment(int id) throws Exception{
		departmentMapper.removeDepartment(id);
	}
}
